Адміністрація вирішила продати даний сайт. За детальною інформацією звертайтесь за адресою: rozrahu@gmail.com

Інформація про навчальний заклад

ВУЗ:
Інші
Інститут:
Не вказано
Факультет:
Не вказано
Кафедра:
Не вказано

Інформація про роботу

Рік:
2024
Тип роботи:
Лекція
Предмет:
ОСА

Частина тексту файла

Лекція 5. Організація обчислень в ОС Android 1. Загальна схема організації обчислень в ОС Android - кожна програма стартує як окремий користувач - схема виконання та взаємодії програм; програмні менеджери - Dalvik -> Java - Linux kernel -> NDK -> C  Рис.1. Загальна схема організації обчислень в ОС Android 2. Основні поняття: Context, Activity, Intent, Service - Context -> контекст виконання програми - Activity -> робота/завдання - Intent -> заявка на виконання дії (повідомлення) - Service -> фонова програма (не використовує інтерфейс користувача) 3. Структура та організація Android-програми - структура -> набір завдань -> {Activity} - як правило, кожне завдання прив’язується до кожного окремого стану інтерфейсу користувача (screen view) - приклад організації Android-програми:  Рис.2. Організація простої Android-гри у вигляді п’яти завдань - паралельне виконання процесів -> лише один процес + лише одне його завдання захоплює екран -> current foreground Activity «There can be only one active application visible to the user at a time — specifically, a single application Activity is in the foreground at any given time.» - Activity stack -> стек завдань  Рис.3. Схема розташування завдань у стеку - Activities of the application (those on the stack that are paused and the one that is active) share the same VM. They also share the same memory heap. - стани Activity: Running, Paused, Stopped Running: In this state, it is the top-level activity that takes up the screen and directly interacts with the user. Paused: This happens when the activity is still visible on the screen but partially obscured by either a transparent activity or a dialog, or if the phone screen is locked. A paused activity can be killed by the Android system at any point in time (e.g., due to low memory). Note that the activity instance itself is still alive and kicking in the VM heap and waiting to be brought back to a running state. Stopped: This happens when the activity is completely obscured by another activity and thus is no longer visible on the screen. Our AndroidBasicsStarter activity will be in this state if we start one of the test activities, for example. It also happens when a user presses the home button to go to the home screen temporarily. The system can again decide to kill the activity completely and remove it from memory if memory gets low. - зупинка Activity -> In both the paused and stopped states, the Android system can decide to kill the activity at any point in time. It can do so politely, by first informing the activity of that by calling its finished() method, or by being bad and silently killing its process. 4. Життєвий цикл Android Activity  Activity.onCreate(): This is called when our activity is started up for the first time. Here we set up all the UI components and hook into the input system. This will only get called once in the life cycle of our activity. Activity.onRestart(): This is called when the activity is resumed from a stopped state. It is preceded by a call to onStop(). Activity.onStart(): This is called after onCreate() or when the activity is resumed from a stopped state. In the latter case, it is preceded by a call to onRestart(). Activity.onResume(): This is called after onStart() or when the activity is resumed from a paused state (e.g., the screen is unlocked). Activity.onPause(): This is called when the activity enters the paused state. It might be the last notification we receive, as the Android system might decide to silently kill our application. We should thus save all state we want to persist in this method! Activity.onStop(): This is called when the activity enters the stopped state. It is preceded by a call to onPause(). This means that before an activity is stopped, it is paused first. As with onPause(), it might be the last thing we get notified of before the Android system silently kills the activity. We could also save persistent state here. However, the system might ...
Антиботан аватар за замовчуванням

23.07.2013 12:07

Коментарі

Ви не можете залишити коментар. Для цього, будь ласка, увійдіть або зареєструйтесь.

Завантаження файлу

Якщо Ви маєте на своєму комп'ютері файли, пов'язані з навчанням( розрахункові, лабораторні, практичні, контрольні роботи та інше...), і Вам не шкода ними поділитись - то скористайтесь формою для завантаження файлу, попередньо заархівувавши все в архів .rar або .zip розміром до 100мб, і до нього невдовзі отримають доступ студенти всієї України! Ви отримаєте грошову винагороду в кінці місяця, якщо станете одним з трьох переможців!
Стань активним учасником руху antibotan!
Поділись актуальною інформацією,
і отримай привілеї у користуванні архівом! Детальніше

Оголошення від адміністратора

Антиботан аватар за замовчуванням

пропонує роботу

Admin

26.02.2019 12:38

Привіт усім учасникам нашого порталу! Хороші новини - з‘явилась можливість кожному заробити на своїх знаннях та вміннях. Тепер Ви можете продавати свої роботи на сайті заробляючи кошти, рейтинг і довіру користувачів. Потрібно завантажити роботу, вказати ціну і додати один інформативний скріншот з деякими частинами виконаних завдань. Навіть одна якісна і всім необхідна робота може продатися сотні разів. «Головою заробляти» продуктивніше ніж руками! :-)

Новини